using System;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
namespace IcsSEMCtrl.Db
{
	public class PreparedSqlParameter
	{
		private List<SqlParameter> sqlParameters = null;
		public PreparedSqlParameter()
		{
			this.sqlParameters = new List<SqlParameter>();
		}
		public List<SqlParameter> GetParameters()
		{
			return this.sqlParameters;
		}
		public void AddParameterToCommand(SqlCommand cmd)
		{
			foreach (SqlParameter current in this.sqlParameters)
			{
				cmd.Parameters.Add(current);
			}
		}
		private void AddParameter(string columnId, SqlDbType dbType, object value)
		{
			SqlParameter sqlParameter = new SqlParameter("@" + columnId, dbType);
			sqlParameter.SourceColumn = columnId;
			sqlParameter.SourceVersion = DataRowVersion.Current;
			sqlParameter.Direction = ParameterDirection.Input;
			sqlParameter.Value = value;
			this.sqlParameters.Add(sqlParameter);
		}
		public void SetBigInt(string columnId, long value)
		{
			this.AddParameter(columnId, SqlDbType.BigInt, value);
		}
		public void SetBinary(string columnId, Array value)
		{
			this.AddParameter(columnId, SqlDbType.Binary, value);
		}
		public void SetBit(string columnId, bool value)
		{
			this.AddParameter(columnId, SqlDbType.Bit, value);
		}
		public void SetChar(string columnId, string value)
		{
			this.AddParameter(columnId, SqlDbType.Char, value);
		}
		public void SetDateTime(string columnId, DateTime value)
		{
			this.AddParameter(columnId, SqlDbType.DateTime, value);
		}
		public void SetDecimal(string columnId, decimal value)
		{
			this.AddParameter(columnId, SqlDbType.Decimal, value);
		}
		public void SetFloat(string columnId, double value)
		{
			this.AddParameter(columnId, SqlDbType.Float, value);
		}
		public void SetImage(string columnId, Array value)
		{
			this.AddParameter(columnId, SqlDbType.Image, value);
		}
		public void SetInt(string columnId, int value)
		{
			this.AddParameter(columnId, SqlDbType.Int, value);
		}
		public void SetMoney(string columnId, decimal value)
		{
			this.AddParameter(columnId, SqlDbType.Money, value);
		}
		public void SetNChar(string columnId, string value)
		{
			this.AddParameter(columnId, SqlDbType.NChar, value);
		}
		public void SetNText(string columnId, string value)
		{
			this.AddParameter(columnId, SqlDbType.NText, value);
		}
		public void SetNVarChar(string columnId, string value)
		{
			this.AddParameter(columnId, SqlDbType.NVarChar, value);
		}
		public void SetReal(string columnId, float value)
		{
			this.AddParameter(columnId, SqlDbType.Real, value);
		}
		public void SetSmallDateTime(string columnId, DateTime value)
		{
			this.AddParameter(columnId, SqlDbType.SmallDateTime, value);
		}
		public void SetSmallInt(string columnId, short value)
		{
			this.AddParameter(columnId, SqlDbType.SmallInt, value);
		}
		public void SetSmallMoney(string columnId, decimal value)
		{
			this.AddParameter(columnId, SqlDbType.SmallMoney, value);
		}
		public void SetText(string columnId, string value)
		{
			this.AddParameter(columnId, SqlDbType.Text, value);
		}
		public void SetTimestamp(string columnId, Array value)
		{
			this.AddParameter(columnId, SqlDbType.Timestamp, value);
		}
		public void SetTinyInt(string columnId, byte value)
		{
			this.AddParameter(columnId, SqlDbType.TinyInt, value);
		}
		public void SetUdt(string columnId, SqlDbType value)
		{
			this.AddParameter(columnId, SqlDbType.Udt, value);
		}
		public void SetUniqueIdentifier(string columnId, Guid value)
		{
			this.AddParameter(columnId, SqlDbType.UniqueIdentifier, value);
		}
		public void SetVarBinary(string columnId, Array value)
		{
			this.AddParameter(columnId, SqlDbType.VarBinary, value);
		}
		public void SetVarChar(string columnId, string value)
		{
			this.AddParameter(columnId, SqlDbType.VarChar, value);
		}
		public void SetVariant(string columnId, SqlDbType value)
		{
			this.AddParameter(columnId, SqlDbType.Variant, value);
		}
		public void SetXml(string columnId, string value)
		{
			this.AddParameter(columnId, SqlDbType.Xml, value);
		}
	}
}
